<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>1024程序节游戏设计</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" th:href="@{/ui/css/amazeui.min.css}">
    <link th:href="@{/css/jquery-letterfx.min.css}" rel="stylesheet" type="text/css"/>
    <style type="text/css" media="screen">
        body {
            background-color: #A2D97E;
        }

        .loginForm {
            margin-top: 10rem;
        }

        .td {
            height: 50px
        }

        .table {
            width: 380px;
            margin: 0 auto;
        }

        .btn {
            width: 310px;
            background-color: #edc56e;
            font-family: "楷体";
            color: #fff;
            line-height: 30px;
            font-size: 16px;
            margin-top: 30px;
            border-radius: 40px 40px 40px 40px;
        }
    </style>
</head>
<body>
<div class="am-g">
    <div class="col-md-6 col-md-centered" align="center">
        <form id="loginForm" class="loginForm am-form am-form-horizontal" th:action="@{/user}" th:method="post">
            <div class="am-form-group">
                <label class="col-sm-3 am-form-label">部门：</label>
                <div class="col-sm-9">
                    <input type="text" name="departmentName">
                </div>
            </div>

            <div class="am-form-group">
                <label class="col-sm-3 am-form-label">姓名：</label>
                <div class="col-sm-9">
                    <input type="text" name="userName">
                </div>
            </div>
            <div class="am-form-group">
                <div class="col-md-6 col-md-centered">
                    <button type="submit" class="am-btn am-btn-default btn" onclick="login()">提交</button>
                </div>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript" th:src='@{/jquery/jquery-3.4.1.js}'></script>
<script type="text/javascript" th:inline="javascript">
    function login() {
        var departmentName = $.trim($("input[name='departmentName']").val());
        var userName = $.trim($("input[name='userName']").val());
        if (departmentName == "") {
            alert("请输入部门！");
            return false;
        }
        if (userName == "") {
            alert("请输入姓名！");
            return false;
        }
        $("#loginForm").submit()
    }
</script>
</body>
</html>